home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / KoApplication.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-30  |  2.5 KB  |  86 lines

  1. /* This file is part of the KDE project
  2.    Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
  3.  
  4.    This library is free software; you can redistribute it and/or
  5.    modify it under the terms of the GNU Library General Public
  6.    License as published by the Free Software Foundation; either
  7.    version 2 of the License, or (at your option) any later version.
  8.  
  9.    This library is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.    Library General Public License for more details.
  13.  
  14.    You should have received a copy of the GNU Library General Public License
  15.    along with this library; see the file COPYING.LIB.  If not, write to
  16.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  17.  * Boston, MA 02110-1301, USA.
  18. */
  19.  
  20. #ifndef __ko_app_h__
  21. #define __ko_app_h__
  22.  
  23. namespace std { }
  24. using namespace std;
  25. #include <kapplication.h>
  26. #include <koffice_export.h>
  27.  
  28. class KoApplicationPrivate;
  29.  
  30. /**
  31.  *  @brief Base class for all %KOffice apps
  32.  *
  33.  *  This class handles arguments given on the command line and
  34.  *  shows a generic about dialog for all KOffice apps.
  35.  *
  36.  *  In addition it adds the standard directories where KOffice applications
  37.  *  can find their images etc.
  38.  *
  39.  *  If the last mainwindow becomes closed, KoApplication automatically
  40.  *  calls QApplication::quit.
  41.  */
  42. class KOFFICECORE_EXPORT KoApplication : public KApplication
  43. {
  44.     Q_OBJECT
  45.  
  46. public:
  47.     /**
  48.      * Creates an application object, adds some standard directories and
  49.      * initializes kimgio.
  50.      */
  51.     KoApplication();
  52.  
  53.     /**
  54.      *  Destructor.
  55.      */
  56.     virtual ~KoApplication();
  57.  
  58.     // ######### Bad name
  59.     /**
  60.      * Call this to start the application.
  61.      *
  62.      * Parses command line arguments and creates the initial shells and docs
  63.      * from them (or an empty doc if no cmd-line argument is specified ).
  64.      *
  65.      * You must call this method directly before calling QApplication::exec.
  66.      *
  67.      * It is valid behaviour not to call this method at all. In this case you
  68.      * have to process your command line parameters by yourself.
  69.      */
  70.     virtual bool start();
  71.  
  72.     /**
  73.      * @return true if the application is starting
  74.      */
  75.     static bool isStarting();
  76.  
  77. private:
  78.     bool initHack();
  79.     KoApplicationPrivate* d;
  80.     static bool m_starting ; ///< is the application starting or not
  81.     class ResetStarting;
  82.     friend class ResetStarting;
  83. };
  84.  
  85. #endif
  86.